
	class Date {

	private int day;
	private int month;
	private int year;
	
	public Date(int d,int m, int yr){
		this.day = d;
		this.month = m;
		this.year = yr;
	}
	
	//methods
	
	public int getDay(){
		return this.day;
	}
	
	public int getMonth(){
		return this.month;
	}
	
	public int getYear(){
		return this.year;
	}
	
	static public boolean checkLeapyear(int year){
		if (year % 4 == 0 ){
		if (year % 100 == 0 && year % 400 != 0){
				return false;
		}
			else{
				return true;
			}
		}
		else{
			return false;
		}
	}
	
	public boolean compareDate(Date other){
		return ((this.day == other.day) && (this.month == other.month && this.year == other.year));
	}
	
	//check that date is correct
	
	static public boolean checkDate(int day,int month, int year){
		
		if (month < 1 || month > 12 || day > 31 || day < 1){
				return false;
			}
		else{
				if (month == 4 || month == 6 || month == 9 || month == 11 ){
					if (day > 30 || day < 1){
						return false;
					}
					else{
						return true;
					}
				}
				if (month == 2 && checkLeapyear(year) == true){
							if (day > 29 || day < 0){
								return false;
							}
							else{
								return true;
							}
						}
						else{
							if (day > 28 || day < 0){
								return false;
							}
							else{
								return true;
							}
					}
				
		}
			}
			}
